package mapengine;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmt.modisco.infra.query.core.exception.ModelQueryExecutionException;
import org.eclipse.gmt.modisco.infra.query.core.java.IJavaModelQuery;
import org.eclipse.gmt.modisco.infra.query.core.java.ParameterValueList;
import org.eclipse.gmt.modisco.infra.query.runtime.ModelQueryParameterValue;

import uimigration.WidgetsModel.APIModel;

/** My finder */
public class Finder implements IJavaModelQuery<EObject, Object> {
	public Object evaluate(final EObject context, final ParameterValueList parameterValues)
			throws ModelQueryExecutionException {
		APIModel api = (APIModel)context;
		ModelQueryParameterValue name=parameterValues.getParameterValueByName("widgetName");
		if(name!=null)
			return api.findWidget(name.toString());
		return null;
	}
}
